<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>详情</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('doedit')}"
          enctype="multipart/form-data" id="uploadForm">


        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>时间
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="date" name="time" class="form-control" value="{$res['time']}" readonly>
            </div>
        </div>


        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>公司内部提交人
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" value="{$res['uname']}" readonly>
                <input type="hidden" name="leader" value="{$res.leader}">
            </div>
        </div>


        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>班组长
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" value="{$res['lname']}" readonly>
                <input type="hidden" name="leader" value="{$res.leader}">
            </div>
        </div>

        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>班组
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" value="{$res['ltype']}" readonly>
                <input type="hidden" name="leaType" value="{$res.leaType}">
            </div>
        </div>



        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>申请事件
            </label>
            <div class="col-md-6 col-sm-10">
                <textarea cols="20" rows="5" name="desc" class="form-control" readonly>{$res.desc}</textarea>
            </div>
        </div>

        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>是否作废
            </label>
            <div class="col-md-6 col-sm-10">
                <select name="del" id="" class="form-control">
                    <?php
                        if($res['del'] == 2){
                        ?>
                    <option value="2">作废</option>

                    <?php
                        }else{
                        ?>
                    <option value=""></option>

                    <?php
                           }
                        ?>
                    <option value="2">作废</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>凭据图片
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="file" name="img[]" class="form-control" id="imgUpload" multiple accept="image/*" />
                <div id="imgPreviewContainer" class="image-preview-container" style="margin-top: 10px; display: flex; flex-wrap: wrap;"></div>
            </div>
        </div>


        <input type="hidden" name="id" value="{$res['id']}">


        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
            </div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/image-uploader.js"></script>
<script>
    // 页面加载完成后初始化所有功能
    document.addEventListener('DOMContentLoaded', function() {
        // 初始化图片上传组件
        // 凭据图片上传
        const imgUploader = new ImageUploader({
            inputId: 'imgUpload',
            previewContainerId: 'imgPreviewContainer',
            fieldName: 'img',
            existingImages: [
                <if condition="$res['img'] !== false">
                    <volist name="res['img']" id="v" key="k">
                        "{$v}",
                    </volist>
                </if>
            ],
            useDataTransfer: true
        });
    });
</script>
</body>
</html>